<template>
<div style="background-color: white">
  <el-tag size="medium" style="height: 42px;
    margin-left: 10px;
      margin-top: 10px;">查询资产资料</el-tag>
  <div class="static-content-item" style="padding-bottom: 20px">
    <el-divider direction="horizontal">常用条件</el-divider>
  </div>
  <el-form :model="formData" ref="vForm" :rules="rules" label-position="left" label-width="120px" style="margin-left: 40px"
           size="default" @submit.prevent>

    <el-row>
      <el-col :span="10" class="grid-cell">
        <el-form-item label="名称：" prop="input39023" class="label-right-align">
          <el-input v-model="formData.input39023" type="text" clearable></el-input>
        </el-form-item>
      </el-col>
      <el-col :span="10" class="grid-cell">
        <el-form-item label="编号：" prop="input96256" class="label-right-align">
          <el-input v-model="formData.input96256" type="text" clearable></el-input>
        </el-form-item>
      </el-col>
      <el-col :span="10" class="grid-cell">
        <el-form-item label="资产类型：" prop="input77847" class="label-right-align">
          <el-select v-model="value" filterable placeholder="请选择" >
            <el-option class="aaaaaaa"
                v-for="item in options"
                :key="item.value"
                :label="item.label"
                :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
      </el-col>
      <el-col :span="10" class="grid-cell">
        <el-form-item label="预计归还日期：" prop="input33797" class="label-right-align">
          <el-select v-model="value_2" filterable placeholder="请选择" >
            <el-option class="aaaaaaa"
                       v-for="item in options_2"
                       :key="item.value_2"
                       :label="item.label"
                       :value="item.value">
            </el-option>
          </el-select>

        </el-form-item>
      </el-col>
    </el-row>
  </el-form>
    <el-divider direction="horizontal">查询结果</el-divider>
    <div style="height: 365px">
      <el-table :data="tableData" style="width: 100%">
        <el-table-column prop="id" label="物品编号" width="130"> </el-table-column>
        <el-table-column prop="goods_name" label="物品名称" width="130"> </el-table-column>
        <el-table-column prop="conservator" label="管理员" width="130"> </el-table-column>
        <el-table-column prop="is_consumable" label="是否为易耗品" width="130"> </el-table-column>
        <el-table-column prop="specification" label="规格型号" width="130"> </el-table-column>
        <el-table-column prop="depriciation" label="折旧" width="130"> </el-table-column>
        <el-table-column prop="residuals_rate" label="残值率" width="130"> </el-table-column>
        <el-table-column prop="worth" label="价值"> </el-table-column>
      </el-table>
    </div>
  <div class="block">
    <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        v-model:currentPage="currentPage3"
        :page-size="100"
        layout="prev, pager, next, jumper"
        :total="100"
    >
    </el-pagination>
  </div>
  </div>

</template>

<script>
import {
  defineComponent,
  toRefs,
  reactive,
  getCurrentInstance
}
  from 'vue'
export default defineComponent({
  data() {
    return {
      currentPage3: 5,
      options: [
        {
          value: '选项1',
          label: '耐用品',
        },
        {
          value: '选项2',
          label: '消耗品',
        },

      ],
      options_2: [
        {
          value: '选项1',
          label: '全部',
        },
        {
          value: '选项2',
          label: '今天',
        },
        {
          value: '选项3',
          label: '本周',
        },
        {
          value: '选项4',
          label: '本月',
        },{
          value: '选项5',
          label: '本年',
        },

      ],
      value: '',
      value_2: '',
      tableData: [],
    }
  },
  methods:{
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`)
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`)
    },
  },
  components: {},
  props: {},
  setup() {
    const state = reactive({
      formData: {
        input39023: "",
        input96256: "",
        input77847: "",
        input33797: "",
      },
      rules: {},
    })
    const instance = getCurrentInstance()
    const submitForm = () => {
      instance.ctx.$refs['vForm'].validate(valid => {
        if (!valid) return
        //TODO: 提交表单
      })
    }
    const resetForm = () => {
      instance.ctx.$refs['vForm'].resetFields()
    }
    return {
      ...toRefs(state),
      submitForm,
      resetForm,
    }
  }
})

</script>

<style lang="scss">
.aaaaaaa{
  float: none;
}



.el-input-number.full-width-input,
.el-cascader.full-width-input {
  width: 100% !important;
}

.el-form-item--medium {
  .el-radio {
    line-height: 36px !important;
  }

  .el-rate {
    margin-top: 8px;
  }
}

.el-form-item--small {
  .el-radio {
    line-height: 32px !important;
  }

  .el-rate {
    margin-top: 6px;
  }
}

.el-form-item--mini {
  .el-radio {
    line-height: 28px !important;
  }

  .el-rate {
    margin-top: 4px;
  }
}

.clear-fix:before,
.clear-fix:after {
  display: table;
  content: "";
}

.clear-fix:after {
  clear: both;
}

.float-right {
  float: right;
}

</style>

<style lang="scss" scoped>
div.table-container {
  table.table-layout {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;

    td.table-cell {
      display: table-cell;
      height: 36px;
      border: 1px solid #e1e2e3;
    }
  }
}

div.tab-container {}

.label-left-align ::v-deep .el-form-item__label {
  text-align: left;
}

.label-center-align ::v-deep .el-form-item__label {
  text-align: center;
}

.label-right-align ::v-deep .el-form-item__label {
  text-align: right;
}

.custom-label {}

.static-content-item {
  min-height: 20px;
  display: flex;
  align-items: center;

  ::v-deep .el-divider--horizontal {
    margin: 0;
  }
}

</style>